package com.erpx.utils;

import com.erpx.utils.serialize.JsonSerializer;
import com.fasterxml.jackson.core.type.TypeReference;

import java.lang.reflect.Type;

public class JsonUtils {
    public static JsonSerializer Default = new JsonSerializer();
    public static String serialize(Object object) throws Exception {
       return Default.serialize(object);
    }

    public static  <T> T deserialize(String str, Type type) throws Exception {
        return Default.deserialize(str,type);
    }

    public static  <T> T deserialize(String str, TypeReference<T> type) throws Exception {
        return Default.deserialize(str,type.getType());
    }
}
